﻿//----------------------------------------------------

#region 命名空间

//    版权：
//    作者：
//建立时间：2012-09-11 00:00:33
//    描述：
//----------------------------------------------------
using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using System.Linq;
using WinnerCMS.Data;
using WinnerCMS.Model;
using WinnerCMS.Common;

#endregion

namespace WinnerCMS.BLL
{
    /// <summary>
    /// 业务逻辑类 WinnerCMS_GoodsParts 的摘要说明。
    /// </summary>
    public class GoodsPartsManage
    {
        private static readonly GoodsPartsDal MyDAL = new GoodsPartsDal();

        #region 添加

        /// <summary>
        /// 添加
        /// </summary>
        public void Add(int parentId, IList<string> goodsIDs)
        {
            if (goodsIDs.Count == 0) return;

            MyDAL.Add(parentId, goodsIDs.Cast<int>().ToArray());
        }

        #endregion

        /// <summary>
        /// 捆绑销售商品
        /// </summary>
        /// <param name="dlBundling"></param>
        /// <param name="goodsId"></param>
        /// <returns></returns>
        public void BindList(DataList dlBundling, int goodsId)
        {
            dlBundling.DataSource = MyDAL.GetLists(goodsId);
            dlBundling.DataBind();
        }
    }
}